<template>
    <el-container class = "home_container">
        <el-aside width="200px" style="">
            <el-menu :router='true'>
<!--&lt;!&ndash;                :router='true'&ndash;&gt; 添加上路由-->
                <el-submenu index="1">
                    <template slot="title"><i class="el-icon-message"></i>外卖店家</template>
                        <el-menu-item index="sellList">商品列表</el-menu-item>
                        <el-menu-item index="SellOrder">订单中心</el-menu-item>
                        <el-menu-item index="center">修改个人信息</el-menu-item>
                </el-submenu>
            </el-menu>
        </el-aside>

        <el-container>
            <el-header >
                <el-row><el-button  type = "primary" @click="logout">店铺{{this.nickname}}-退出</el-button>
                </el-row>
            </el-header>
            <el-main>
            <!--                具体路由变化的页面-->
                <router-view></router-view>
            </el-main>
        </el-container>

    </el-container>
</template>
<style>
    .home_container{
        height: 100%;
    }

    .el-header{
        background-color: #2b4b6b;
        color:#fff;
        text-align: right;
        height: 40px;
        font-size: 12px;
    }

    .el-button{
        height: 100%;
    }
    .el-aside {
        background-color: #ccc;
        height: 100%;
    }

    .el-main{
        background-color: #fff;
    }

</style>

<script>
export default {
    data() {
        return {
            nickname:window.sessionStorage.getItem('nickname'),
        }
    },
    methods:{
        logout(){
            console.log("退出");
            window.sessionStorage.removeItem('token');
            this.$router.push('/login')
        }
    }
};
</script>
